package com.sky.mapper;

import com.sky.anno.TableInject;
import com.sky.entity.Employee;
import com.sky.enumeration.OperationType;
import com.sky.vo.EmployeePageVO;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

@Mapper
public interface EmployeeMapper {

    /**
     * 根据用户名查询员工
     * @param username
     * @return
     */
    Employee getByUsername(String username);

    /**
     * 添加员工
     * @param employee
     */
    @TableInject(OperationType.INSERT)
    void add(Employee employee);

    /**
     * 根据姓名查找员工(支持模糊查询)
     * @param name
     * @return
     */
    List<EmployeePageVO> findByName(String name);

    /**
     * 修改员工信息
     * @param employee
     */
    @TableInject(OperationType.UPDATE)
    void update(Employee employee);

    /**
     * 根据id查询员工信息
     * @param id
     * @return
     */
    Employee findById(Integer id);
}
